package com.teach.exception;

/**<pre>
 * - 
 * ClassName : com.teach.exception.CodeException
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Date : 2020年8月1日 上午9:54:28
 * Version : 1.0
 * Copyright 2020 jlzhou.top Inc. All rights reserved. 
 * Warning: this content is only for internal circulation of the company. 
 * It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class CodeException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6204373962956843029L;
	private int code;
	private String message;
	
	
	
	
	/**
	 * 
	 */
	public CodeException(int code) {
		super();
		this.code = code;
	}
	/**
	 * @param message
	 * @param cause
	 * @param enableSuppression
	 * @param writableStackTrace
	 */
	public CodeException(int code,String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
		this.code = code;
		this.message = message;
	}
	/**
	 * @param message
	 * @param cause
	 */
	public CodeException(int code,String message, Throwable cause) {
		super(message, cause);
		this.code = code;
		this.message = message;
	}
	/**
	 * @param message
	 */
	public CodeException(int code,String message) {
		super(message);
		this.code = code;
		this.message = message;
	}
	/**
	 * @param cause
	 */
	public CodeException(int code,Throwable cause) {
		super(cause);
		this.code = code;
	}
	
	
	
	public String getMessage() {
		return message==null?("code."+code):message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public int getCode() {
		return code;
	}
	
	
	
}
